package com.trendata.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.trendata.dao.ICommentDao;
import com.trendata.domain.Comment;

@Service("commentService")
public class CommentService {

	@Autowired
	private ICommentDao commentDao;

	public void insert(Comment comment) {
		commentDao.insert(comment);
	}

	public int deleteById(long id) {
		return commentDao.deleteById(id);
	}

	public int deleteByImageId(long imageId) {
		return commentDao.deleteByImageId(imageId);
	}

	public Comment selectById(long id) {
		return commentDao.selectById(id);
	}

	public List<Comment> selectByImageId(long imageId) {
		return commentDao.selectByImageId(imageId);
	}

	public int selectCountByImageId(long imageId) {
		return commentDao.selectCountByImageId(imageId);
	}

}
